package com.gitee.mall.cart.service;

import com.gitee.mall.cart.vo.Cart;
import com.gitee.mall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {
    CartItem getCartItem(Long skuId);

    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     *
     * @return
     */
    Cart getCart() throws ExecutionException, InterruptedException;

    /**
     * 清空购物车数据
     * @param cartkey
     */
    void clearCart(String cartkey);

    List<CartItem> getUserCartItems();

    void deleteItem(Long skuId);

    void changeItemCount(Long skuId, Integer num);

    void checkItem(Long skuId, Integer check);
}
